package en.edu.zxj.springrabbimqdemo.listener;

import en.edu.zxj.springrabbimqdemo.constant.Constants;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description：
 *
 * @author: zxj
 * @date: 2024-09-20
 * @time: 14:29:47
 */
@Component
public class FanoutListener {
    // 监听队列1
    @RabbitListener(queues = Constants.FANOUT_QUEUE_NAME1)
    public void listenerQueue1(String message) {
        System.out.println("fanout.queue1 消费消息：" + message);
    }

    // 监听队列2
    @RabbitListener(queues = Constants.FANOUT_QUEUE_NAME2)
    public void listenerQueue2(String message) {
        System.out.println("fanout.queue2 消费消息：" + message);
    }
}
